-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix :end-coords-interpolation problems #325
Fix :end-coords-interpolation problems #325
Conversation
Great,
|
will pass the tests, but would cause another problem... |
On this topic, I have also thought about making the time-interval of the IK's (in this case 100) an option and/or passing &rest arguments to the IK call (like :thre). At the end I found it to be too many options for a rarely-used method and did not implement it, but what do you think about it? Is it worth it?
As a result I got a rather smooth path, but calculations took a long time and final angle-vector was pretty different from given one. However, without |
Sorry for late. |
ok, I have updated https://github.com/jsk-ros-pkg/jsk_pr2eus/pull/326/files, this will chose smoothest interpolation from different strategy, check if this works for @Affonso-Gui and did not break your current system @pazeshun
can you add this change to PR?
Is 449446b ok?
Not sure if I understand correctly, does #326 solve your problem? since |
Interesting approach, but still had some problems when testing. Pointed out some of them on #326, some others are the ones already commented above.
Also, it seems to be somewhat cost-expensive: it took me around 5 seconds to calculate the path for
Added :use-torso and :end-coords-interpolation-pass-time to this PR 6db0e99 Actually I do not believe that the main problem is the path not being smooth enough, but rather the fact that the trajectory gets split up in pr2-interface, before reaching robot-interface's |
498105b
to
c1f8dc8
Compare
c1f8dc8
to
1937dfa
Compare
Updated for
|
@@ -454,6 +455,7 @@ | |||
(dolist (av avs) | |||
(send robot :angle-vector av) | |||
(setq end-coords-current (mapcar #'(lambda (limb) (send robot limb :end-coords :copy-worldcoords)) limbs)) | |||
(setq diff (v- (v- av (setq av (v+ av-prev (send self :sub-angle-vector av av-prev)))) diff-prev)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Affonso-Gui I have added your code to #326, but not sure about the logic of this code.
I thought...
setq av..
update av
from avs
to av-prev + sub-angle-vector
, so if there is no 180 rotation this new av
is av
. Let set this new av as new-av
.
Then, we calculate av - new-av - diff-prev
, If new-av
is equal to av
, then diff
is - diff-prev
, Where did I go wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@k-okada It's exactly as you said, when there is no 180 turns diff
is set to - diff-prev
, meaning to undo last rotation.
For example, in an av
sequence from
0 → 1000 → 0
the new-av
sequence becomes:
0 → - 80 → 0
Which is then used to set midpoint
for IK.
In this case we have an over 180 deg rotation at first interpolation (0 → 1000
) and none at the second (- 80 → 0
), making the diff
become:
+1080 , -1080
Which is then slowly added to prev-av
and to the IK result (Line 484) in order to generate something like:
0 → 200 → 500 → 800 → 1000 → 800 → 500 → 200 → 0
thank you for explanation, merged. |
Fixing some problems in :end-coords-interpolation.
Namely,
Does not behave properly when over-360 degree turns are present. This is because pr2-interface splits the angle vector in its midpoints, which is not what we want to do in :end-coords-interpolation.
Move only in 50 ms when all end-coords are the same.
IK usually fails when the head moves. Dealing with it by having :head and :torso move by midpoint vector, instead of IK.
It actually does not send designed angle-vector in the end.
Solving IK in order may cause arms IK to change desired torso position. Adding :use-torso nil.
This problems can be reproduced with
Captures showing the above code executed on both master branch and after the changes are bellow.
master
with changes